package benchmarks.benchmarktests;

public abstract class BenchmarkTest<TSolution> {
	final TSolution solution;
	
	BenchmarkTest(TSolution solution) {
		this.solution = solution;
	}
	
	public abstract Thread[] InitializeThreads();
	
	public void run() {
        Thread[] initializedThreads = InitializeThreads();
        for(Thread initializedThread : initializedThreads)
        {
            initializedThread.start();
        }
        for(Thread initializedThread : initializedThreads)
        {
            try {
				initializedThread.join();
			} catch (InterruptedException e) {
				throw new RuntimeException("Threads were interrupted! " + e.getMessage());
			}
        }
        runAdditionalTests();
	}

	public abstract void runAdditionalTests();
}
